gtk_im_context_set_client_widget() allows passing NULL as widget to signal that
the widget no longer exists. The xim implementation didn't handle that
case which led to the test suite on gitlab-ci failing.
GtkWidget *widget)
{
GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context);
- GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
+ GdkWindow *window = NULL;
- set_ic_client_window (context_xim, gtk_widget_get_window (toplevel));
+ if (widget != NULL)
+ window = gtk_widget_get_window (gtk_widget_get_toplevel (widget));
+
+ set_ic_client_window (context_xim, window);
}
GtkIMContext *